package com.cctc.service.impl;


import com.cctc.service.WareOrderTaskService;
import com.cctc.service.WareSkuService;
import com.cctc.ware.CommandManager;

import java.util.Map;

/**
 * 库存商品信息
 * @author lichao
 * @email li2chao@126.com
 * @date 2024/01/13 10:58:27
 */
public class WareSkuServiceImpl implements WareSkuService {

    private WareOrderTaskService wareOrderTaskService;
    public WareSkuServiceImpl(WareOrderTaskService wareOrderTaskService) {
        this.wareOrderTaskService = wareOrderTaskService;
    }
    public void setWareOrderTaskService(WareOrderTaskService wareOrderTaskService) {
        this.wareOrderTaskService = wareOrderTaskService;
    }

    // [方法注入] 演示程序
    private CommandManager commandManager;
    public WareSkuServiceImpl() {}
    public void setCommandManager(CommandManager commandManager) {
        this.commandManager = commandManager;
    }
    @Override
    public Map<String, Object> systemCallCommand(Map<String, Object> command) {
        return commandManager.process(command);
    }

    @Override
    public void syncWareSku(Long skuId, Long wareId, Integer skuNum) {
        // 完成采购需求（项）之后，更新库存信息
        // 1. 如果库存中存在采购需求（项），则更新库存数量
        // 2. 否则，新增一条库存记录
    }

}